'use strict';

angular.module('app').directive('appPositionClass',[function(){
    return {
        restrict:'A',
        replace:true,
        scope:{
            com:'='
        },
        templateUrl:'view/template/positionClass.html',
        link:function($scope){
            $scope.showPositionList = function(i){
                $scope.positionList = $scope.com.positionClass[i].positionList;
                $scope.isActive = i;
               
            };
            $scope.$watch('com',function(newVal){
                if(newVal){
                     $scope.showPositionList(0);
                }
            });
           
        }

    };
}]);